package day05.demo02;

public class Demo03ArraySame {
    public static void main(String[] args) {
        int[] ArrayA = new int[3];//动态初始化
        System.out.println(ArrayA);//地址值
        System.out.println(ArrayA[0]);//0
        System.out.println(ArrayA[1]);//0
        System.out.println(ArrayA[2]);//0

        //改变数组当中的内容
        ArrayA[1] = 10;
        ArrayA[2] = 20;
        System.out.println(ArrayA);//地址值
        System.out.println(ArrayA[0]);//0
        System.out.println(ArrayA[1]);//10
        System.out.println(ArrayA[2]);//20

        //将ArrayA的地址值赋值给ArrayB
        int[] ArrayB = ArrayA;//动态初始化
        System.out.println(ArrayB);//地址值
        System.out.println(ArrayB[0]);//0
        System.out.println(ArrayB[1]);//10
        System.out.println(ArrayB[2]);//20

        //改变数组当中的内容
        ArrayB[1] = 100;
        ArrayB[2] = 200;
        System.out.println(ArrayB);//地址值
        System.out.println(ArrayB[0]);//0
        System.out.println(ArrayB[1]);//100
        System.out.println(ArrayB[2]);//200
    }

}
